<template>
  <div class="about">
    <div v-for="(item,index) in categorys" :key="index">{{item.name}}</div>
  </div>
</template>

<script setup lang="ts">
import { getCates } from '@/api/category'
import { ref } from 'vue'  //响应式数据
import type { CategoryList } from '@/types'

// const list: any = ref([])
const categorys = ref([] as CategoryList)
getCates<CategoryList>().then((res) => {
  // console.log(res)
  categorys.value = res
  console.log(categorys)
})
</script>